<template>
  <div class="card">
    <div class="bg" :style="{ backgroundImage: `url(${img})` }"></div>
    <p class="title">{{ title }}</p>
    <p class="sub">{{ sub }}</p>
  </div>
</template>

<script>
export default {
  props: ["img", "title", "sub"],
};
</script>

<style lang="scss" scoped>
.card {
  margin-top: 24px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 10px -1px #000;
  overflow: hidden;
  .bg {
    width: 100%;
    height: 250px;
    background-position: 0px -110px;
    background-image: url("http://1.s140i.faiusr.com/2/AIwBCAAQAhgAIIjw69UFKMic1fMHMIAPOIAK!640x640.jpg");
  }
  .title {
    padding: 24px;
    color: #333;
    font-size: 16px;
    font-weight: 700;
    &:hover {
      color: #ff6637;
    }
  }
  .sub {
    padding: 0 0 24px 24px;
    color: #878787;
    font-size: 14px;
  }
}
</style>
